<style type="text/css">
	textarea {width: 580px;height:100px;}
	td {width: 600px;}
	.font-size {float:right;font-size:24px;}
	.dialog {width:600px;height:138px;display:none;background-color: #CAFFFF;position: absolute;z-index:1002;
overflow: auto;margin-left: 30%;margin-top: -30%;}
.x {float:right;font-size:20px;margin-right:15px;background-color:red;width:15px;}
.black_overlay{display: none;position: absolute;top: 0%;left: 0%;width: 100%;height: 100%;background-color: black;z-index:1001;-moz-opacity: 0.8;opacity:.60;
	filter: alpha(opacity=80);
}
.div-label{margin-top:20px;}
</style>
<%=link_to 'categories' , categories_path%>
<%=form_for @info do |f|%>
	<div>
		<table>
			<%@categories.each do |cate|%>
			<tr>
				<td>
				<%  if cate.name != "基本信息" %>
					<h3><%=cate.name%></h3>
				<%else%>
					<h3><%=cate.name%></h3>
					<label>门店名称<input name="store"></label>
					<label>负责人<input name="store"></label>
				<%end%>
				</td>
			</tr>
		</table>
		<%cates=InfoCategory.where(parent_id: cate.id)%>
		<table>
			<%cates.each do |ca|%>
			<tr>
				<td>
					<input type="hidden" name="category_id" value="<%=ca.id%>" >
					<% if ca.name != "门店工位" %>
					<input type="hidden" name="is_pay" value="0">
					<label><%=ca.name%><input name="infos[<%=ca.id%>][value]"></label>
					<%else%>
					<br>
					<label><%=ca.name%></label>
					<div style="border:1px solid #F00;width:598px;height:106px;">
						<table >
							<textarea id="text_area" name="infos[<%=ca.id%>][value]"></textarea>
							<div class="font-size" id="div_<%=ca.id%>" data-wo="<%=ca.id%>">
							dsa
							</div>
						</table>
					</div>
					<%end%>
				</td>
			</tr>
		<%end%>
		</table>
	</div>
	<%end%>
	<div id="fade" class="black_overlay">
	</div>
	<div class="dialog">
		<table>
			<div>
				<div class="x">X</div>
			</div>
			<div>
				<div class="div-label">
					<tr>
						<td>
							<label style="font-size:18px;">工位名称:</label><input type="text" id="station_name">
							<label style="font-size:18px;margin-left:50px;">工位数量:</label><input type="text" id="station_quanlity">
						</td>
					</tr>
				</div>
			</div>
		</table>
		<div style="margin-top:40px;margin-laft:50px;">
				<input type="button" value="确定" id="sure" />
		</div>
	</div>

	<%=f.submit '创建' %>
<% end %>
<script type="text/javascript">
	$("div.font-size").click(function(){
		$("div.dialog").show();
		$("div.black_overlay").show();
		var id=$(this).data("wo")
		// alert(id);
	});
	$("div.x").click(function(){
		$("div#fade").hide();
		$("div.dialog").hide();
	});

	$("input:button#sure").click(function(){
		var name=$("input#station_name").val();
		var quanlity=$("input#station_quanlity").val();

		$("textarea#text_area").append(name+quanlity+";")
		alert("?");
		$("div#fade").hide();
		$("div.dialog").hide();
	});
</script>